﻿using ApprovalTests;
using ApprovalTests.Reporters;
using Microsoft.SmallBasic.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SmallBasicFun.Tests
{
	
	[TestClass]
	[UseReporter(typeof(DiffReporter))]
	public class ColorWheelTest
	{
		
		[TestMethod]
		public void TestColorWheel()
		{
			ColorWheel.AddColor("red");
			ColorWheel.AddColor("blue");
			ColorWheel.AddColor("pink");
			ApproveColorWheel(6);
		}

		private static void ApproveColorWheel(int times)
		{
			string o = "";
			for (int i = 0; i < times; i++)
			{
				o += ColorWheel.GetNextColor() + "\r\n";
			}
			Approvals.Verify(o);
			ColorWheel.RemoveAllColors();
		}

		[TestMethod]
		public void TestClear()
		{
			ColorWheel.AddColor("red");
			ColorWheel.RemoveAllColors();
			ColorWheel.AddColor("blue");
			ColorWheel.AddColor("pink");
			ApproveColorWheel(4);
		}
		[TestMethod]
		public void TestRequestFromEmpty()
		{
			ColorWheel.SetWheel(new Wheel<Primitive>());
			ColorWheel.RemoveAllColors();
			ColorWheel.GetNextColor();
			

		}

	}
}
